package com.xunyun.kotlinwc.login.viewmodel

import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.MutableLiveData
import com.xunyun.kotlinwc.base.BaseViewModel
import com.xunyun.kotlinwc.login.model.UserBean
import com.xunyun.kotlinwc.login.repository.LoginRepository


/**
 * @author gl
 * @date 2021/9/8
 * @desc
 */
class LoginViewModel : BaseViewModel() {


    var mLoginLiveData: MutableLiveData<UserBean> = MutableLiveData();
    fun login(name: String, password: String, lifecycleOwner: LifecycleOwner) {
        LoginRepository.get()
            .getUser(name, password, lifecycleOwner, mLoginLiveData, infoMsg, isLoading)

    }

    /*  val mLoginLiveData = MutableLiveData<Result<UserBean>>()

  fun login(name: String, password: String) {
        viewModelScope.launch {
          val result = NetworkApi.login(name,password)
            mLoginLiveData.value = result
        }


    }*/

}